feat: Don't warn about expected user changes in safe-sessions#28983
Merged
feat: Don't warn about expected user changes in safe-sessions#28983
Conversation
This adds a test around what actually happens when an unexpected user-change happens.
This is intended to silence a rare false positive that seems to happen when someone logs in on a browser that already has an active session for another user. We believe there should be no further positives once this case is handled. - login and logout views annotate the response to indicate the session user should be changing between the request and response phases - safe-sessions middleware skips the verify-user check when this annotation is present ref: ARCHBOM-1878
a9c1702 to
484b1d9
Compare
timmc-edx
commented
Oct 8, 2021
| # page is used during an active session. | ||
| # | ||
| # The relevant views set a flag to indicate the exemption. | ||
| if getattr(response, 'safe_sessions_expected_user_change', None): |
Contributor
Author
There was a problem hiding this comment.
This just checks if it is present, like a flag. I was thinking of actually using the new_user_id present in the dict to validate that it matches up, which would of course add a different thing we might alert on...
rgraber
approved these changes
Oct 8, 2021
(and interpolate the actual user IDs rather than hardcoding)
|
Your PR has finished running tests. There were no failures. |
Contributor
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
Contributor
|
EdX Release Notice: This PR has been deployed to the production environment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is intended to silence a rare false positive that seems to happen when someone logs in on a browser that already has an active session for another user. We believe there should be no further positives once this case is handled.
Also improve tests and docs and remove an old workaround for the logout case.
Affected roles
LMS operators.
Supporting information
Ticket: ARCHBOM-1878
Testing instructions
Deadline
None